<?php
$this->breadcrumbs=array(
	UserModule::t('Users')=>array('/user'),
	UserModule::t('Manage'),
);

$this->menu=array(
    array('label'=>UserModule::t('Create User'), 'url'=>array('create')),
    array('label'=>UserModule::t('Manage Users'), 'url'=>array('admin')),
    array('label'=>UserModule::t('Manage Profile Field'), 'url'=>array('profileField/admin')),
    array('label'=>UserModule::t('List User'), 'url'=>array('/user')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
    $('.search-form').toggle();
    return false;
});	
$('.search-form form').submit(function(){
    $.fn.yiiGridView.update('user-grid', {
        data: $(this).serialize()
    });
    return false;
});
");

?>



<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'user-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		array(
			'name' => 'id',
			'type'=>'raw',
			'value' => 'CHtml::link(CHtml::encode($data->id),array("admin/update","id"=>$data->id))',
		),
		array(
			'name' => 'username',
			'type'=>'raw',
			'value' => 'CHtml::link(UHtml::markSearch($data,"username"),array("admin/view","id"=>$data->id))',
		),
		array(
			'name'=>'email',
			'type'=>'raw',
			'value'=>'CHtml::link(UHtml::markSearch($data,"email"), "mailto:".$data->email)',
		),
		'create_at',
		'lastvisit_at',
		array(
			'name'=>'superuser',
			'value'=>'User::itemAlias("AdminStatus",$data->superuser)',
			'filter'=>User::itemAlias("AdminStatus"),
		),
		array(
			'name'=>'status',
			'value'=>'User::itemAlias("UserStatus",$data->status)',
			'filter' => User::itemAlias("UserStatus"),
		),
		array(
			'class'=>'CButtonColumn',
		),
	),
)); ?>

<style>
    div.buttons{
        background-image: url("/easyui/images/linkbutton_bg.png");
        background-position: right 0;
        background-repeat: no-repeat;
        border-radius: 5px 5px 5px 5px;
        color: #444444;
        cursor: pointer;
        display: inline-block;
        float: right;
        font-size: 12px;
        height: 24px;
        outline: medium none;
        padding-right: 18px;
        text-decoration: none;
        float: left;
    }
    a[type="button"]{
        background: url("/easyui/images/button_span_bg.gif") no-repeat scroll left top transparent;
        display: inline-block;
        height: 16px;
        line-height: 18px;
        padding: 4px 0 4px 18px;
        border: 0;
    }
    div.row label{
        min-width: 80px;
    }
    input[disabled], select[disabled], textarea[disabled], input[readonly], select[readonly], textarea[readonly] {
        cursor:pointer;
    }
    select.combo{
        width: auto;
    }
    div#time1,div#time2,input#Imgs_ctime, input#Imgs_utime{
        float: left;
        display: inline-block;
    }
    div#time1{
        margin-right: 20px;;
    }
    img.clock{
        display: none;
    }
    div#ui-datepicker-div{display: none;}
</style>
<link rel="stylesheet" type="text/css" href="/ui/themes/default/easyui.css" />
<div class="row buttons" style="float:right;margin: 20px;">
    <a type="button" href="/index.php/user/logout">退出</a>
</div>
